3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
To write a model or other 3D data into a file conforming to the QuickDraw 3D Object Metafile format, you can use submit calls (such as Q3Object_Submit ) with an open file object that is attached to a storage object. Depending on the complexity of the model and the amount of available memory, QuickDraw 3D might need to traverse the model more than once to write the data to the target physical storage device. Accordingly, you should perform all write operations within a writing loop, bracketed by calls to Q3View_StartWriting and Q3View_EndWriting . Listing 6 illustrates a simple writing loop.
Listing 6 Writing 3D data to a file object
Q3View_StartWriting(myView, myFileObj);
do {
Q3Object_Submit(myModel, myView);
Q3Polyline_Submit(&myAnimatedData, myView);
Q3TriGrid_Submit(&myBumpExtrapolationGrid, myView);
} while (Q3View_EndWriting(myView) == kQ3ViewStatusRetraverse);
Previous | QD3D Book | Overview | Chapter Contents | Next |